24. Applications of Taylor Series
c.1. Integrals
There are many integrals which can not be computed exactly. We previously saw how to approximate a definite integral as a Riemann sum. However, if we know a Taylor series for the integrand, we can
- express the indefinite integral as a power series within its interval of convergence,
- express the definite integral as a numerical series and compute it exactly if we can sum the series, and
- approximate the definite integral as a partial sum of the numerical series provided we know it converges.
Evaluate \(\displaystyle \int e^{-x^2}\,dx\) as a power series centered at \(x=0\). Find its radius of convergence.
Substitute \(x\to-x^2\) into the exponential series \[ e^x=\sum_{n=0}^\infty \dfrac{x^n}{n!} \] to get \[ e^{-x^2}=\sum_{n=0}^\infty (-1)^n\dfrac{x^{2n}}{n!} \] Now integrate both sides: \[ \int e^{-x^2}\,dx =\sum_{n=0}^\infty (-1)^n\dfrac{x^{2n+1}}{(2n+1)n!}+C \] Since the series for \(e^x\) has an infinite radius of convergence, so does the series for \(e^{-x^2}\) and that for \(\displaystyle \int e^{-x^2}\,dx\). Alternatively, you can apply the Ratio Test directly to the series \(\displaystyle \sum_{n=0}^\infty (-1)^n\dfrac{x^{2n+1}}{(2n+1)n!}\) to see it converges for all \(x\).
Approximate \(\displaystyle \int_0^1 e^{-x^2}\,dx\) to within \(\pm 10^{-3}\).
In the previous example, we found a series expansion for \(\displaystyle \int e^{-x^2}\,dx\). So \[ \int_0^1 e^{-x^2}\,dx =\left[\sum_{n=0}^\infty (-1)^n\dfrac{x^{2n+1}}{(2n+1)n!}\right]_0^1 =\sum_{n=0}^\infty \dfrac{(-1)^n}{(2n+1)n!} \] This is an alternating series. So we can approximate it by a finite number of terms with the error bounded by the absolute value of the next term. The term with \(n=5\) is \[ \left|\dfrac{(-1)^5}{(2\cdot5+1)5!}\right| =\dfrac{1}{11\cdot120}=\dfrac{1}{1320} \lt 10^{-3} \] So it is sufficient to keep the terms up to \(n=4\). \[\begin{aligned} \int_0^1 e^{-x^2}\,dx &\approx\dfrac{(-1)^0}{(2\cdot0+1)0!} +\dfrac{(-1)^1}{(2\cdot1+1)1!} +\dfrac{(-1)^2}{(2\cdot2+1)2!} \\ &\qquad+\dfrac{(-1)^3}{(2\cdot3+1)3!} +\dfrac{(-1)^4}{(2\cdot4+1)4!} \pm \dfrac{(-1)^5}{(2\cdot5+1)5!} \\ &=1-\dfrac{1}{3}+\dfrac{1}{10}-\dfrac{1}{42}+\dfrac{1}{216} \pm \dfrac{1}{1320} \approx .7475\pm .0007 \end{aligned}\]
Evaluate \(\displaystyle \int \arctan(x^2)\,dx\) as a power series centered at \(x=0\). Find its radius of convergence.
\[ \arctan x =\sum_{n=0}^\infty (-1)^n\dfrac{x^{2n+1}}{2n+1} =x-\dfrac{x^3}{3}+\dfrac{x^5}{5}+\cdots \]
\(\begin{aligned}\displaystyle
\int \arctan(x^2)\,dx
&=\sum_{n=0}^\infty (-1)^n\dfrac{x^{4n+3}}{(2n+1)(4n+3)}+C \\
&=\dfrac{x^3}{3}-\dfrac{x^7}{21}+\dfrac{x^{11}}{55}+\cdots+C
\end{aligned}\)
\(R=1\)
We substitute \(x\to x^2\) into the series: \[ \arctan x=\sum_{n=0}^\infty (-1)^n\dfrac{x^{2n+1}}{2n+1} =x-\dfrac{x^3}{3}+\dfrac{x^5}{5}+\cdots \] to get: \[ \arctan(x^2)=\sum_{n=0}^\infty (-1)^n\dfrac{x^{4n+2}}{2n+1} =x^2-\dfrac{x^6}{3}+\dfrac{x^{10}}{5}+\cdots \] We integrate both sides: \[\begin{aligned} \int \arctan(x^2)\,dx &=\sum_{n=0}^\infty (-1)^n\dfrac{x^{4n+3}}{(2n+1)(4n+3)}+C \\ &=\dfrac{x^3}{3}-\dfrac{x^7}{21}+\dfrac{x^{11}}{55}+\cdots+C \end{aligned}\] The series for \(\arctan x\) converges for \(|x| \lt 1\). So the series for \(\arctan(x^2)\) converges for \(|x^2| \lt 1\) which is equivalent to \(|x| \lt 1\). So the series for \(\displaystyle \int \arctan(x^2)\,dx\) also converges for \(|x| \lt 1\). Alternatively, the Ratio Test says the series converges when: \[\begin{aligned} \lim_{n\to\infty}\left|\dfrac{a_{n+1}}{a_n}\right| &=\lim_{n\to\infty} \left|\dfrac{x^{4(n+1)+3}}{(2[n+1]+1)(4[n+1]+3)} \cdot\dfrac{(2n+1)(4n+3)}{x^{4n+3}}\right| \\ &=|x^4| \lt 1 \end{aligned}\] or \(|x| \lt 1\). So the radius of convergence is \(R=1\).
Approximate \(\displaystyle \int_0^{0.1} \arctan(x^2)\,dx\) to within \(\pm 10^{-10}\).
\[\begin{aligned} \int \arctan(x^2)\,dx &=\sum_{n=0}^\infty (-1)^n\dfrac{x^{4n+3}}{(2n+1)(4n+3)}+C \\ &=\dfrac{x^3}{3}-\dfrac{x^7}{21}+\dfrac{x^{11}}{55}+\cdots+C \end{aligned}\]
\(\displaystyle \int_0^{0.1} \arctan(x^2)\,dx \approx3.333\,285\,714\times10^{-4}\pm1.8\times10^{-13} \)
\[\begin{aligned} \int \arctan(x^2)\,dx &=\sum_{n=0}^\infty (-1)^n\dfrac{x^{4n+3}}{(2n+1)(4n+3)}+C \\ &=\dfrac{x^3}{3}-\dfrac{x^7}{21}+\dfrac{x^{11}}{55}+\cdots+C \end{aligned}\] So \[\begin{aligned} \int_0^{0.1} \arctan(x^2)\,dx &=\sum_{n=0}^\infty (-1)^n\dfrac{(0.1)^{4n+3}}{(2n+1)(4n+3)} \\ &=\dfrac{(0.1)^3}{3}-\dfrac{(0.1)^7}{21}+\dfrac{(0.1)^{11}}{55}+\cdots \end{aligned}\] This is an alternating series and \(\dfrac{(0.1)^{11}}{55} \lt 10^{-10}\). So \[\begin{aligned} \int_0^{0.1} \arctan(x^2)\,dx &\approx\dfrac{(0.1)^3}{3}-\dfrac{(0.1)^7}{21}\pm \dfrac{(0.1)^{11}}{55} \\ &\approx3.333\,285\,714\times10^{-4}\pm1.8\times10^{-13} \end{aligned}\]
In the above examples and exercises, the series were all alternating. So we could use the alternating series bound to bound the remainder. In the exercises on the next page, the series are not alternating. So we will need to use the Taylor bound on the remainder.
Heading
Placeholder text: Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum